format PE64 GUI 5.0
entry start

include 'win64a.inc'
include 'aes/aes.inc'

TEXTSIZE equ BLOCK_SIZE

section '.text' code readable executable

  start:
    fastcall encAES, TEXTSIZE, clear_msg, enc_msg, key128
    fastcall decAES, TEXTSIZE, enc_msg, dec_msg, key128

    ;fastcall encAES, TEXTSIZE, clear_msg, enc_msg, key192
    ;fastcall decAES, TEXTSIZE, enc_msg, dec_msg, key192

    ;fastcall encAES, TEXTSIZE, clear_msg, enc_msg, key256
    ;fastcall decAES, TEXTSIZE, enc_msg, dec_msg, key256

    invoke getchar
    invoke ExitProcess, 0

include 'aes/aes.asm'

section '.data' data readable writeable

  clear_msg db 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,\
	       0x30, 0x31, 0x32, 0x33, 0x34, 0x35
  enc_msg   rb TEXTSIZE
  dec_msg   rb TEXTSIZE

  key128    db 0x31, 0x30, 0x30, 0x32, 0x33, 0x30, 0x30, 0x34,\
	       0x35, 0x30, 0x30, 0x36, 0x37, 0x30, 0x30, 0x38
  key192    db 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04,\
	       0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0e, 0x0d, 0x0c,\
	       0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04
  key256    db 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04,\
	       0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0e, 0x0d, 0x0c,\
	       0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04,\
	       0x0b, 0x0a, 0x09, 0x08, 0x0f, 0x0e, 0x0d, 0x0c

section '.idata' import data readable writeable

  library kernel,'KERNEL32.DLL',\
	  msvcrt,'MSVCRT'

  import kernel,\
	 ExitProcess,'ExitProcess'

  import msvcrt,\
	 printf,'printf',\
	 getchar,'_fgetchar'
